x86/mce: sanitise the #MC entry path
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 18 Jun 2014 13:51:28 +0000 (15:51 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 18 Jun 2014 13:51:28 +0000 (15:51 +0200)
commitaf9505932c0e00233fa2d060f1607ac0b174ac6b
treedc68a184ac5440791deb3f73d993ab04371c12a0
parent84c340ba4c3eb99278b6ba885616bb183b88ad67
x86/mce: sanitise the #MC entry path

The 'error_code' function parameters are not used at all; drop it from the
call chain.  If it is needed at some point in the future, it is available via
cpu_user_regs.

Having do_machine_check() call the non-inlineable machine_check_vector() just
to get at the static function pointer '_machine_check_vector' is silly.  Move
do_machine_check() from traps.c to mce.c and do away with
machine_check_vector() entirely.

Both {intel,amd}_init_mce() register their own local function as the #MC
handler, each of which call mcheck_cmn_handler() in an identical way.  Fix
this craziness by actually turning mcheck_cmn_handler() into a valid #MC
handler (as its comments already state), and have {intel,amd}_init_mce()
register it instead of their own private handlers.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Christoph Egger <chegger@amazon.de>
xen/arch/x86/cpu/mcheck/mce.c
xen/arch/x86/cpu/mcheck/mce.h
xen/arch/x86/cpu/mcheck/mce_amd.c
xen/arch/x86/cpu/mcheck/mce_intel.c
xen/arch/x86/traps.c
xen/include/asm-x86/traps.h